76ca5aca52f0609431ade705b54fca95a889c438,gateway/src/main/java/com/continuuity/gateway/router/RouterMain.java,RouterMain,createGuiceInjector,#CConfiguration#ZKClientService#,113
Before Change
}
static Injector createGuiceInjector(CConfiguration cConf, ZKClientService zkClientService) {
return Guice.createInjector(
new ConfigModule(cConf),
new LocationRuntimeModule().getDistributedModules(),
new DiscoveryRuntimeModule(zkClientService).getDistributedModules(),
new AbstractModule() {
@Override
protected void configure() {
bind(WeaveRunnerService.class).to(YarnWeaveRunnerService.class);
bind(new TypeLiteral<Iterable<WeaveRunner.LiveInfo>>() {}).toProvider(WeaveLiveInfoProvider.class);
}
@Provides
@Named(Constants.Router.ADDRESS)
public final InetAddress providesHostname(CConfiguration cConf) {
return Networks.resolve(cConf.get(Constants.Router.ADDRESS),
new InetSocketAddress("localhost", 0).getAddress());
}
@Singleton
@Provides
private YarnWeaveRunnerService provideYarnWeaveRunnerService(CConfiguration configuration,
YarnConfiguration yarnConfiguration,
LocationFactory locationFactory) {
String zkNamespace = configuration.get(Constants.CFG_WEAVE_ZK_NAMESPACE, "/weave");
return new YarnWeaveRunnerService(yarnConfiguration,
configuration.get(Constants.Zookeeper.QUORUM) + zkNamespace,
LocationFactories.namespace(locationFactory, "weave"));
}
}
);
}
private static class WeaveLiveInfoProvider implements Provider<Iterable<WeaveRunner.LiveInfo>> {
After Change
}
static Injector createGuiceInjector(CConfiguration cConf, ZKClientService zkClientService) {
return Guice.createInjector(
new ConfigModule(cConf),
new LocationRuntimeModule().getDistributedModules(),
new DiscoveryRuntimeModule(zkClientService).getDistributedModules(),
new RouterModules().getDistributedModules()
);
}
}